﻿@model Modules.Database.User

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="content-language" lang="zh-cn">
    <title>问卷系统找回密码</title>
    <link href="~/Content/bootstrap2.css" rel="stylesheet" />
    <style>
        body {
            color: white;
        }

        .main-position {
            width: 60%;
            margin: 150px auto;
        }

            .main-position .control-group {
                margin-left: 50px;
            }
    </style>
</head>
<body>
    <div class="container">
        <div class="main-position">
            @using (Html.BeginForm("ResetPassword", "Auth", FormMethod.Post, new { @class = "form_horizontal", Ares = "UserOP", id="findform" }))
            {
                <input type="hidden" name="id" value="@Model.Id" />
                <fieldset>
                    <legend>
                        <img src="~/images/logo_blue.png" />
                        <span style="color:#0088cc;">找回密码</span>
                    </legend>
                    <div class="control-group">
                        <input type="password" name="newpassword" placeholder="新密码" class="span4" style="height: 40px;line-height:40px;" />
                    </div>
                    <div class="control-group">
                        <input type="password" name="newpasswordcomfirm" placeholder="确认新密码" class="span4" style="height: 40px;line-height:40px;" />
                    </div>
                    <div class="control-group">
                        <button type="submit" class="btn btn-primary span2" style="margin-left: 0px;">提交</button>
                    </div>
                </fieldset>
            }
        </div>
    </div>
    <script>
        $("#findform").submit(function () {
            var password = $("input[name='newpassword']").val();
            var confirmpassword = $("input[name='newpasswordcomfirm']").val();

            if (password == "" || typeof (password) == 'undefined') {
                $("#Msg").text("新密码不能为空");
                $("input[name='newpassword']").focus();
                return false;
            }
            if (password != confirmpassword) {
                $("#Msg").text("两次密码不一致");
                $("input[name='newpasswordcomfirm']").focus();
                return false;
            }
    });
    </script>
</body>
</html>
